home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 6 / MacMania 6.toast / / Tools&Utilities / TouchMe 1.2□ / touchMe 1.2 Folder / touchMe source codes / CW11 PP source / source / CTouchMeMainWindow.h < prev    next >
Encoding:
Text File  |  1997-04-25  |  3.8 KB  |  110 lines  |  [TEXT/CWIE]

  1. // ==================================================
  2. //    CTouchMeMainWindow.h
  3. //    Copyright (C) 1996-1997 Mizutori Tetsuya
  4. //    July 4, 1996; February 3, 1997; April 23, 1997.
  5. // ==================================================
  6. //    All documents are pretty-printed in 10-point Geneva font.
  7.  
  8. #pragma once
  9.  
  10. #include <LDialogBox.h>
  11. #include <LBroadcaster.h>
  12. #include <LDragAndDrop.h>
  13. #include <LCommander.h>
  14.  
  15. #include "CPrefsFile.h"
  16. #include "CTouchMePref.h"
  17.  
  18.  
  19. class LCommander;
  20.  
  21.  
  22. class CTouchMeMainWindow : public LDialogBox , public LBroadcaster, public LDragAndDrop {
  23.  
  24. public:
  25.     enum { class_ID = 'TmeD' };
  26.  
  27.     static CTouchMeMainWindow *    CreateTouchMeMainWindowStream( LStream *inStream );
  28.                     CTouchMeMainWindow( LStream *inStream );
  29.                     ~CTouchMeMainWindow();
  30.  
  31.  
  32.     virtual void        FindCommandStatus( CommandT inCommand,
  33.                             Boolean &outEnabled, Boolean &outUsesMark,
  34.                             Char16 &outMark, Str255 outName );
  35.  
  36.     // Control the synchronous RadioButton changes
  37.     // Control the 'Current Date Time Now!' button, and others
  38.     virtual void        ListenToMessage( MessageT inMessage, void *ioParam );
  39.  
  40.     // Set and Get dialog status according to the 'CTouchMePref' instance data
  41.     // Get the global frame rect, a bound of dialog
  42.     void                GetGlobalFrameRect( Rect & outRect );
  43.     // Move the dialog window
  44.     void                MoveWindow( Rect & inRect );
  45.     // Setup dialog status according to the 'pref' data
  46.     void                SetupDialog( const SPrefsRec & inPrefs );
  47.     // Set the 'pref' data according to the dialog status
  48.     void                InspectDialog( SPrefsRec & outPrefs );
  49.     // Show an indiactor whether the modifier key is pressed
  50.     void                Indicator( const Boolean inStatus );
  51.  
  52. protected:
  53.  
  54.     // for Dialog
  55.     // Add listeners of RadioButtons to broadcaster of LStdCheckBox
  56.     virtual void        FinishCreateSelf( void );
  57.     // Draw my additional figures in the dialog window
  58.     virtual void        DrawSelf( void );
  59.     // Quit program like as "Cancel" button if "Close Box" was selected
  60.     virtual void        AttemptClose( void );
  61.  
  62. private:
  63.  
  64.     // for Dialog
  65.     void                SetEditFieldText( PaneIDT inPane, const Str255 inString,Boolean toSelectAll = false );
  66.     void                SetEditFieldTextRefresh( PaneIDT inPane, const Str255 inString,Boolean toSelectAll = false );
  67.     void                GetEditFieldText( PaneIDT inPane, Str255 outString,Boolean toSelectAll = false );
  68.     void                SetEditFieldDateTime( PaneIDT inPane, const unsigned long inDateTimeSeconds,Boolean toSelectAll = false );
  69.     PaneIDT            GetPairedPaneID( const PaneIDT inPaneID );
  70.  
  71. //    static Boolean        sGlobalModifier;
  72.     Boolean            mGlobalModifier;
  73.  
  74. protected:
  75.     // for Drag and Drop
  76.     // Drag&Drop; accept files or folders dropped from Finder
  77.     virtual Boolean        ItemIsAcceptable( DragReference inDragRef, ItemReference inItemRef );
  78.  
  79.     // Drag&Drop; retrieve the FSSpec from the dropped object
  80.     // Set the date time stamp fields according to the accepted file
  81.     // Or do touch command if option-key is pressed
  82.     virtual void        ReceiveDragItem( DragReference inDragRef,
  83.                         DragAttributes inDragAttrs, ItemReference inItemRef, Rect &inItemBounds );
  84.     // Drag&Drop; execute once if entered into the area
  85.     virtual void        EnterDropArea( DragReference inDragRef, Boolean inDragHasLeftSender );
  86.     // Drag&Drop; execute once if left from the area
  87.     virtual void        LeaveDropArea( DragReference inDragRef );
  88.     // Drag&Drop; execute while staying in the area
  89.     virtual void        InsideDropArea( DragReference inDragRef);
  90.     // Drag&Drop; assign my custum hilite region of EditFields
  91.     virtual void        HiliteDropArea( DragReference inDragRef );
  92.  
  93. private:
  94.  
  95.     // for Drag and Drop
  96.     Boolean            IsModifierKeyPressed( DragReference inDragRef );
  97.     PaneIDT            FindPaneByMouse( const Point inPoint );
  98.     void                HilitePane( const PaneIDT inPaneID );
  99.     void                HiliteRect( const Rect & inRect );
  100.  
  101.     Boolean            mTEActive;
  102.     Boolean            mModifier;
  103.     Boolean            mTextDrag;
  104.     PaneIDT            mHilitePaneID;
  105.     PaneIDT            mTargetID;
  106.     LCommander *        mTarget;
  107. };
  108.  
  109. // end of definitions
  110.